package com.sc.springboot.controller;

import com.sc.springboot.pojo.PostLike;
import com.sc.springboot.service.IPostLikeService;
import com.sc.springboot.util.ResponseMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 帖子点赞记录表 前端控制器
 * </p>
 *
 * @author romeo
 * @since 2025-09-22 03:08:28
 */
@RestController
@RequestMapping("/postLike")
//帖子点赞记录
public class PostLikeController {

    
    @Autowired
    private IPostLikeService postLikeService;
    
    //点赞
    @RequestMapping("/add")
    public ResponseMsg add(PostLike postLike){
        if (postLikeService.save(postLike)){
            return ResponseMsg.getInstance(ResponseMsg.SUCCESS,"点赞成功");
        }
        return ResponseMsg.getInstance(ResponseMsg.FAIL,"点赞失败");
    }
    
}
